﻿using System.Collections.Generic;
using System.Web.Mvc;
using NotifyPilot.Services;

namespace NotifyPilot.Controllers
{
    public partial class ConfigController
    {
        [HttpGet]
        public ActionResult ServicesConfig()
        {
            var srv = new ServicesConfigurationServices();
            return View(srv.ServicesConfigurations);
        }

        [HttpPost]
        public ActionResult ServicesConfig(IList<Models.ServicesConfiguration> model)
        {
            if (ModelState.IsValid)
            {
                var srv = new ServicesConfigurationServices();
                if (srv.SaveServicesConfiguration(model))
                    return RedirectToAction("Index", "Home");
            }
            return View();
            
        }
    }
}